package fields;

import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Modifier;

public class PlayWithFields {
    static final int testInt = 12;
    boolean a = true;
    boolean b = false;

    public static void main(String[] args) {
        PlayWithFields obj = new PlayWithFields();
//        obj.testInt++;
//        obj.testInt++;
        Class clazz = obj.getClass();
        try {
            Field f = clazz.getDeclaredField("testInt");
            System.out.println(f.getInt(obj));

//            f.setChar(obj, 'a');

            System.out.println(obj.testInt);
            int mod = f.getModifiers();
            System.out.println(Modifier.isFinal(mod));
            System.out.print( Modifier.toString( Member.class.getModifiers() ) );

        } catch (NoSuchFieldException | IllegalAccessException e) {
            e.printStackTrace();
        }
    }
}
